<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
/**
 * 默认的路由
 */
	Route::get('/', function () {
	    return view('welcome');
	});
	
	//后台登陆
	Route::get('/admin/login','CommonController@login');
	Route::post('/admin/login','CommonController@dologin');
	Route::get('/admins/delsession','CommonController@delsession');
	Route::get('/admins/amend','CommonController@amend');
	Route::post('/admins/doamend','CommonController@doamend');

	/**后台路由组
	 * 
	 */
	Route::group(['middleware'=>'login'],function(){

		/**后台管理路由
		 * 
		 */
		Route::get('/admin',function(){
			return view('admin');
		});
		/**
		 * 分类路由
		 */
		Route::controller('cate','CateController');
		/**用户管理
		 * 
		 */
		Route::controller('user','UserController');
		
		/**
		 * 商品管理
		 */
		Route::controller('goods','GoodsController');
	});





	//显示登录页
	Route::get('/home/login','IndexController@login');
	//执行登录操作
	Route::post('/home/dologin','IndexController@dologin');


	Route::group(['middleware'=>'indexlogin'],function(){

		//index显示
		Route::controller('home','IndexController');

		//花礼子页面一
		Route::get('/home/pageone','IndexController@pageone');

		//花礼子页面二
		Route::get('/home/pagetwo','IndexController@pagetwo');
	});

